..Help .Objects

Midi In


Extract midi events from a device or stream.

Pins
io letter name unit description
insistream instreamStream to extract events from.
out sostream outstreamFiltered events removed.
s1stream outFiltered events only.
NNumbermidiMidi number.
VValueMidi value.
eEventlogicEvent edge toggles when event is received.

Parameters
name option description
input source streamExtract commands from the si pin.
deviceExtract commands from a device.
trackerGet note commands from a note tracker.
output filter
port streamSend all commands to the so pin.
clockMonitors the midi tick clock and status of start/stop.
resetMonitor reset events.
channel Channel and note commands require a list of channels ranging from 1 to 16.
streamSend filtered channel commands to the s1 pin.
patchSend patch change events to the V and e pins.
pitch wheelSend pitch wheel events to the V and e pins.
pressureSend channel pressure events to the V and e pins.
controllersSend controller events to the N V and e pins. Requires a list of controllers ranging from 0 to 127.
note Note commands require a list of notes ranging from 0 to 127.
streamSend filtered note events to the s1 pin.
onSend note on events to the N V and e pins.
offSend note off events to the N V and e pins.
pressureSend note pressure events to the N V and e pins.
make trackerDeclare this object as a note tracker.

Notes
The Midi In object is an extractor. Use it to get and format midi commands from an input source. The so output pin will contain what ever events are left over. The other outputs may be discrete values or another midi stream. The original input source is unaffected.

Midi Streams

Streams are not analog signals, they are midi commands, just like a midi cable. Use the Midi In and Midi Out objects to build and manipulate streams.
Streams can be destroyed if run through other objects. For example, running a stream signal through a filter will destroy it.
You can, however, route and select streams using a demultiplexer and multiplexer. s inputs of ±1 will select one or the other, 0 will shut off both. Any other s value will destroy the stream.

Technical:

A stream can hold a maximum of 512 events per frame. This is roughly 20 times the normal midi command rate, plenty for most uses. If a stream is completely full, attempts to add more events will be ignored.
There may be timing adjustments when adding events. To avoid overwriting another event, the new event will delayed by a few dozen micro-seconds.
You can view the contents of a stream using the scope. At the r pin, apply a range value of about 70dB to make the data visible. The stream will appear to fill up with data as the circuit plays, but most, if not all, of it is being ignored.

Using the range edit boxes

The channel, controllers, and notes edit boxes allow you to specify a range of values. You may enter separate numbers, specify a range, or both. When you have entered the desired list, press Enter or select another control.
The order of the numbers is not important.
Specify a range using the - character.
Any other non-digit separates the numbers.
Numbers that are out of range will be truncated.
The edit box will reformat the list to show you what it thinks you meant. Example: If you type in 3, 13-15, 14 channel16 1 and 17, it will be reformatted to 1 3 13-16

Clock Start Stop

This mode monitors the midi tick clock and start stop commands. The e output will toggle (true-false or false-true) at every midi tick. This can be used to provide timing pulses. There are 24 ticks per quarter note. Use dividers to derive longer note pulses. The V output will be true if a start or continue command was received. It will go false when a stop command is received.

Note Trackers

Note Trackers keep track of what notes are currently being played. This allows you to build polyphonic synthesizers with a minimum of logic circuitry.

Trackers have two parts:
1) A source object that receives midi events.
2) One or more destination objects.

Source Object:

To specify a tracker source, use the make tracker mode. This creates a new tracker table which will be available on the tracker input list. Specify the input source, channel(s) to monitor and the range of notes. All note commands will be removed from the so stream.
Two additional settings are available:
SAT Saturate tells the tracker that once all destination objects are busy any further notes are to be ignored. If SAT is off, the new note will replace the oldest note.
Freq Frequency tells all destination objects to output hertz instead of midi numbers. This saves having to convert midi to frequency elsewhere in the circuit.

Destination Objects:

To specify a tracker destination use the tracker input mode and select the desired tracker. This creates a connection to the tracker source object. If there is no source object, the object will not do anything. You may have any number destinations attached to a tracker, each will represent one note. There are no other settings for tracker destinations.
The output pins of tracker destination are:
N Note number will be either a midi number, or a frequency in hertz if the source was set as such. N will remain constant for the duration of the note.
V Velocity will be the note volume. When the note goes on, V will be the attack velocity. During the note, V will change as pressure events are received. When the note goes off, V will be the release velocity.
e Will be 0 (false) when the note is off, and -1 (true) when the note is on. Connect a negative edge trigger to detect note-on note-off events, the ADSR's t input for example. Connect a negative gate to detect the state of the note.

Example:
Three notes.
The left Midi In object uses device LB1 to source tracker 0. Each of the three Midi In's in the center will keep track of one note. The e pins trigger the ADSRs when the notes go on.




©1999-2002 Andy J Turner
All rights reserved.